Use DevController.allocateDeviceID rather than using a local variable.
authoremellor@ewan <emellor@ewan>
Mon, 19 Sep 2005 12:44:05 +0000 (13:44 +0100)
committeremellor@ewan <emellor@ewan>
Mon, 19 Sep 2005 12:44:05 +0000 (13:44 +0100)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/server/usbif.py

index 84cf87e3af89c101f360a830ff2baf121e59b8ab..ccc212f885ef23a3a9ff791069bb1144c47607ae 100644 (file)
@@ -25,9 +25,6 @@
 from xen.xend.server.DevController import DevController
 
 
-next_devid = 1
-
-
 class UsbifController(DevController):
     """USB device interface controller. Handles all USB devices
     for a domain.
@@ -42,9 +39,4 @@ class UsbifController(DevController):
     def getDeviceDetails(self, _):
         """@see DevController.getDeviceDetails"""
 
-        global next_devid
-
-        devid = next_devid
-        next_devid += 1
-
-        return (devid, {}, {})
+        return (self.allocateDeviceID(), {}, {})